<template>
<!--  新增编辑资讯分类-->
  <div>
    <div class="padding15 minMaxWidth600 marginAuto">
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
        <el-form-item label="分类名称" prop="name">
          <el-input :disabled="disabled" class="width100" v-model="ruleForm.name" placeholder="请输入分类名称"></el-input>
        </el-form-item>
       
        <el-form-item label="分类英文" prop="phone">
          <el-input :disabled="disabled" class="width100" v-model="ruleForm.phone" placeholder="请输入分类英文"></el-input>
        </el-form-item>
        <el-form-item label="排序" prop="phone">
          <el-input :disabled="disabled" type="number" class="width100" v-model="ruleForm.phone" placeholder="请输入排序"></el-input>
           
        </el-form-item>
        <el-form-item label="是否显示" prop="status">
          <el-switch
            v-model="ruleForm.status"
            :active-value="1"
            :inactive-value="0"
            active-color="#13ce66"
            inactive-color="#cccccc">
          </el-switch>
        </el-form-item>
        <el-form-item label="独立标识" prop="status">
          <el-switch
            v-model="ruleForm.status"
            :active-value="1"
            :inactive-value="0"
            active-color="#13ce66"
            inactive-color="#cccccc">
        </el-switch>
           
        </el-form-item>
       
    
        <el-form-item>
          <el-button type="primary" :loading="isLoading" :submitDisbled="submitDisbled" @click="submitForm('ruleForm')">确定</el-button>
          <el-button @click="goback">返回</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
//  import {} from '@/assets/api/api'
import {AddEditmixin} from '@/assets/mixins/addEditmixin'

  export default {
    name:'AddEditEvaluateClassList',
    mixins: [AddEditmixin],
    components:{
    },
    data(){
      return{
  
        goBackPath:'/realTimeInfo/evaluateClassList',//返回的路径
          isLoading:false,
        page:this.$route.query.page?this.$route.query.page:1,
        submitDisbled:false,
          infoName:'',//编辑取得名字查重要
        msg1:'新增账号',
          roleName:'',//角色名称
        ruleForm:{
          content:"1",
          name: "",
          phone: "",
          status:0,
          roleId:'',
        
        },
        disabled:false,
        rules: {
          name: [
            { required: true, message: '请输入品牌名称', trigger: 'blur' },
            { min: 3, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur' },
          ],
          phone: [
            { required: true, message: '请输入手机号', trigger: 'blur' },
            { min: 11, max: 11, message: '请输入正确手机号', trigger: 'blur' },
          ],
          roleId: [
            { required: true, message: '请选择会员等级', trigger: 'change' },
          ]
        },
      }
    },
    created() {
     
        
      },
    methods:{
    
      callbackUrl(url){//图片的上传地址
           console.log(url,'callbackUrl')
      },
     
      submitForm(formName) {
        let that = this;
        that.isLoading = true;
      
        this.$refs[formName].validate((valid) => {
          if (valid) {
        
            that.isLoading = false;
          } else {
            that.isLoading = false;
            return false;
          }
        });
      },
    }
  }
</script>
<style lang="scss" scoped>

</style>
